// pages/qxdemand/qxdemand.js
var app = getApp() 
Page({

  /**
   * 页面的初始数据
   */
  data: {
    need: "一",
    bus_name: '',
    bus_logo: '',
    dingdang: '', 
    types:'',
    order: [
      {
        src: "../../img/a_13_19.png",
        name: "西安车工坊营销部",
        status: "订单完成",
        goods_img: "../../img/a_60_03.png",
        info_title: "飞利浦（PHILIPS）迷你车载充电飞利浦（PHILIPS）迷你车载充电",
        price: "69.0",
        quantity: 1,
        total: "69.0"
      },
      {
        src: "../../img/a_13_19.png",
        name: "西安车工坊营销部",
        status: "订单完成",
        goods_img: "../../img/a_60_03.png",
        info_title: "飞利浦（PHILIPS）迷你车载充电飞利浦（PHILIPS）迷你车载充电",
        price: "69.0",
        quantity: 1,
        total: "69.0"
      },
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    that.setData({
      bus_name: wx.getStorageSync('bus_name'),
      bus_logo: wx.getStorageSync('bus_logo')
    })
    if (options.type == 1){
      var type = 1
      that.setData({
        types : type
      })
    } else if (options.type == 2) {
      var type = 0
      that.setData({
        types: type
      })
    }
    wx.request({
      url: app.url + '/order/yifankuan',
      data: {
        bid: wx.getStorageSync('bid'),
        uid: wx.getStorageSync('uid'),
        reback: type
      },
      method: 'GET',
      success: function (res) {
        console.log(res)
        that.setData({
          dingdang: res.data.data
        })
      },
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})